1. Field of the Invention
This invention relates generally to the processing of instructions in a digital computer system. More specifically, it relates to the processing of conditional branch instructions whereby the operand for the branch condition to be evaluated resides on a device external to the processor.
2. Background Information
The ability to make decisions by conditional branching is an essential requirement for any computer system which performs useful work. Conditional branch instructions may be used to construct such high-level programming constructs as loops and if-then-else statements. Because loops and if-then-else programming constructs are so common, it is essential that the conditional branch instructions which implement them execute as efficiently as possible.
The decision to branch or not to branch may be based on one or more events. In most computer systems these events are referred to as conditions and are represented as bits in a condition code (CC) register. Examples of conditions include positive, negative or zero numbers, overflow, underflow, and carry from the last arithmetic operation, and many others. When a CC register is used, the condition is tested by examining the relevant bits in the CC register, which were previously set by arithmetic/logical unit (ALU) operations. An advantage of this approach is that the condition bits are sometimes set without any negative effect on the time for executing instructions. A disadvantage is that condition codes constrain the ordering of instructions since they pass information from one instruction to an immediately following branch instruction. Nevertheless, this method is used by most prior art systems.
Some systems use the "compare and branch" approach. Under this approach, the compare is actually part of the branch instruction. Thus two instructions (compare, branch) are now combined into one instruction, thereby potentially saving time. However, the set of conditions is often limited under this method and the actual implementation may be more complex and require just as much processing time as the two separate instructions.
A third approach is the use of a condition register to hold the value of the condition to be tested. This approach has the advantage being very simple. The disadvantage is that it uses up a register solely to store the condition. One way to eliminate this disadvantage is to store the condition in a register or designator on a device that is external to the processor. This idea will only be feasible if access to the external designator is obtained in an efficient manner. Another benefit of storing the condition on an external device is that now branching by a program executing on a processor may be conditioned by the results of events occurring on the external device. For example, the external device may be an independently executing VLSI gate array. The processor could change program control based upon what is being processed by the VLSI gate array.